<template>
  <div>
    <el-empty v-show="RefundList.length===0" description="暂无需要还款项目，请等待审核" image-size="300px"
              image="http://localhost:99/Public/file/空空如也.png"></el-empty>
    <el-table
        v-show="RefundList.length!==0"
        :data="RefundList"
        height="800px"
        border
        style="width: 100%;">
      <el-table-column
          fixed
          prop="applyId"
          label="编号"
          width="70">
      </el-table-column>
      <el-table-column
          prop="projectName"
          label="项目名称"
          width="180">
      </el-table-column>
      <el-table-column
          prop="name"
          label="姓名"
          width="80">
      </el-table-column>
      <el-table-column
          prop="major"
          label="专业"
          width="120">
      </el-table-column>
      <el-table-column
          prop="phone"
          label="电话号码"
          width="120">
      </el-table-column>
      <el-table-column
          prop="address"
          label="状态"
          width="120">
        <template #default="{ row }">
          <el-tag :type="refundType(row.address)">
            {{ row.address }}
          </el-tag>
        </template>
      </el-table-column>
      <el-table-column
          prop="applyTime"
          label="申请时间"
          width="180">
      </el-table-column>
      <el-table-column
          fixed="right"
          label="操作"
          width="90">
        <template slot-scope="scoped">
          <el-button @click="toRefund(scoped.row)" type="text" size="small">查看</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "AdminRefund",
  data() {
    return {
      RefundList: [],
    }
  },
  mounted() {
    this.getRefundList();
  },
  methods: {
    getRefundList() {
      this.$axios.get("/adminFinancial/getRefundList?role=" + this.$store.getters.getUser.role).then(res => {
        this.RefundList = res.data.data
      })
    },
    refundType(row){
      if (row === "还款未启动")
        return ""
      return "success"
    },
    toRefund(row) {
      this.$router.push({
        path: "/refundInfo", query: {
          applyId: row.applyId,
        }
      })
    }
  }
}
</script>

<style scoped>

</style>